<template>
	<view>
		<view :style="{height}"></view>
		<view :class="['set-submit-bt',{'u-flex':isBtnGroup}]" :style="{paddingBottom: bottom + 'rpx', backgroundColor: bgColor}">
			<u-button v-if="isBtnGroup" :throttle-time="1000" hover-class="none" shape="circle" :ripple="true" :hair-line="false" :custom-style="cancelBthStyle" @tap.stop="cancel($event)">
				{{ cancaelText }}
				<image v-if="textImg" :src="textImg" style="width: 30rpx;height: 30rpx;margin-left: 13rpx;" mode=""></image>
			</u-button>
			<u-button :throttle-time="1000" hover-class="none" shape="circle" :ripple="true" :hair-line="false" :custom-style="getBtStyle('default', isBtnGroup?300:-1, 90, fontSize)" @tap.stop="click($event)">
				{{ text }}
				<image v-if="textImg" :src="textImg" style="width: 30rpx;height: 30rpx;margin-left: 13rpx;" mode=""></image>
			</u-button>
			<view class="u-text-center u-m-t-30" v-if="isDempShow">
				<text style="color: #999;font-size:30rpx;text-decoration: underline;" @tap.stop="dempFn($event)" >
					跳过
				</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			bottom: {
				type: Number,
				default: 100
			},
			text: {
				type: String,
				default: '保存'
			},
			cancaelText: {
				type: String,
				default: '取消'
			},
			
			bgColor: {
				type: String,
				default: '#FFFFFF'
			},
			fontSize: {
				type: Number,
				default: 28
			},
			textImg: {
				type: String,
				default: ''
			},
			isBtnGroup:{
				type: Boolean,
				default: false
			},
			isDempShow:{
				type: Boolean,
				default: false
			}
		},
		data() {
			return {
				cancelBthStyle:{
					backgroundColor: '#fff',
					width: 300 + 'rpx',
					height: 90 + 'rpx',
					fontSize: 28 + 'rpx',
					border: 1
				}
			}
		},
		computed: {
			height() {
				return 150 + this.bottom+(this.isDempShow?40:0) + 'rpx'
			}
		},
		methods: {
			click(e) {
				this.$emit('click', e)
			},
			cancel(e) {
				this.$emit('cancel', e)
			},
			dempFn(e){
				this.$emit('dempFn', e)
			}
		}
	}
</script>

<style scoped>
	.set-submit-bt {
		position: fixed;
		z-index: 999;
		width: 100%;
		bottom: 0;
		padding: 30rpx 35rpx 0 35rpx;
	}
</style>
